package com.cyber.app_container.mapper;

import com.cyber.app_container.dto.UserDTO;
import com.cyber.app_container.entity.User;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring")
public interface UserMapper {
    UserMapper INSTANCE = Mappers.getMapper(UserMapper.class);

    UserDTO toDto(User user);

    @Mapping(target = "password", ignore = true)
    @Mapping(target = "phoneNumber", ignore = true)
    User toEntity(UserDTO dto);
}